1. Field of the Invention
The present invention relates to a printer controller, a printer control method, and to a computer-readable medium that records the printer controller (e.g. in the case of a software printer driver) and/or the printer control method. More particularly, the present invention relates to a printer controller and a printer control method for preventing printer operating errors in a printer that processes real-time commands. Such errors may occur when such a printer receives for printing an image data stream containing a data sequence identical to a real-time command data sequence. The present invention also relates to a data storage medium for recording a computer-readable program for performing the printer control method and or embodying the printer controller as a software printer driver.
2. Description of the Related Art
Printers are widely used for printing text and images on paper and other printing media. Such printers are typically connected to a data processing terminal such as a personal computer or other type of general purpose host computer. The host computer or terminal sends to the printer a data stream containing the text, images, and other data to be printed, as well as a data stream for controlling printer operation. This type of host computer thus functions as a printer control device (referred to simply as a “printer controller” herein).
The data sent from the host computer can be thought of as a bit stream or a byte stream. Many printers use a command system expressed using units of 8 bits (1 byte). The number of bits in each command is thus a multiple of eight, and commands are constructed using a data stream containing a number of bytes.
A data stream for printing text typically contains the byte values for the ASCII codes of characters to be printed, while a method of expressing black and white pixels by individual bits in a byte stream is used for printing images and user-defined fonts or characters. A technique for printing color images uses a number of bits contained in each byte to express the color of each pixel in an image. Data thus expressing images for printing is referred to as image data below.
When the printer receives one or a plurality of bytes from a host computer via a host/printer interface, a receive interrupt occurs and a receive interrupt process is initiated. This receive interrupt process includes the following operations:    (1) detecting whether a real-time command is contained in the received data, and immediately executing the process corresponding to the real-time command if a real-time command is received; and    (2) storing the received data in a receive buffer comprising a reserved portion of RAM (Random Access Memory).
Normal commands and print data are processed in first-in first-out (FIFO) sequence after being stored in the receive buffer. However, real-time commands are high priority commands that are processed before being stored in the receive buffer, and are given precedence over normal commands and print data.
Normal processing resumes when the receive interrupt process ends. This normal process interprets the data stream stored in the receive buffer, and generates a print image in the print buffer reserved as a portion of RAM. This print image is typically a bit stream of 1s and 0s indicative of which parts of the print area are to be printed white and which parts are black, that is, a bit stream used to control print head drive. When image data for one pass (e.g., one line) of the print head is generated, the print head is driven according to the print buffer contents to print the text and/or image.
When the data stream read from the receive buffer is a data sequence of a real-time command, the normal process simply skips the command because a process for that command has already been completed in the receive interrupt process.
Commands described below have conventionally been used as real-time commands. It should be noted that the byte sequences shown below are represented by the conventional mnemonics for the corresponding ASCII codes:                DLE EOT NUL: send the printer status to the host computer in real time;        DLE EOT BEL: send the printer ink status to the host in real time;        DLE EOT BS: send the MICR (magnetic ink character recognition) status to the host in real time;        DLE ENQ: real-time request to printer; and        DLE DC4 SOH: output a specific pulse in real time.        
The hexadecimal expressions for the above mnemonics are defined as shown below where “0x” is a prefix indicating a hexadecimal number:                NUL=0x00        SOH=0x01        EOT=0x04        ENQ=0x05        BEL=0x07        BS=0x08        DLE=0x10        DC4=0x14.        
As shown above, byte values other than NUL, SOH, EOT, ENQ, BEL, BS, DLE, and DC4 are not contained in real-time command data streams.
An image print command typical of a normal command conventionally used for printing an image 8 dots high and n dots wide has the following format:                ESC 0x6d n d1 . . . dn        where the values d1 to dn are eight bit values indicating which bits arranged eight high are black and which are white. In other words, the values d1 to dn are an image data stream. The value “n” in this print command is defined herein as the length parameter, and the n-byte long data stream of values d1 to dn is defined as the image data parameter. These parameters can be any desired byte value.        
A problem is that a data stream identical to a real-time command can circumstantially occur in the data stream of an image data sequence. This can result in a process corresponding to an actual real-time command being performed in the receive interrupt process described above even though the received data stream should not be interpreted as a real-time command.
This means that an unexpected real-time command process is executed at a time unexpected by the host computer. This may result, for example, in the host computer losing the ability to communicate with the printer because the printer is returning status data to the host at a time when the host is not prepared to receive and process the status data.
There is, therefore, a need for a printer capable of processing real-time commands that, when it receives an image data stream containing a bit or byte sequence identical to a real-time command data sequence, can properly print the image data rather than improperly perform the real-time command process.
Methods for achieving this result by changing or expanding the printer command system are conceivable. However, there is also a great need for the ability to distinguish and process real-time command data streams separately from other data streams in a way that enables continued use of existing printer resources; that is, in a way that does not require existing printer resources to be replaced.